<?php
/* ========== ########## ========== ########## ========== ########## ========== */
/*                                                                              */
/*   WHMCS v4.1.2 NULLED R4 by FLIPMODE  [ BAD SYNTAX ]                         */
/*                                                                              */
/*                             INTERNAL BAD SYNTAX NULLED VERSION: 2.5.9.6 R4   */
/*                                                                              */
/*   ALL files have been analysed, cleaned and nulled of:                       */
/*     - Call Backs  (100%)                                                     */
/*     - Link Backs (95%)                                                       */
/*     - Licensing  (100%)                                                      */
/*     - Remote Links + URL's                                                   */
/*                                                                              */
/*   WHMCS v4.1.2 RELEASED: 4th November 2009                                   */
/*    -> FIRST v4.1.2 NULL R1: 19th November 2009                               */
/*    -> UPDATED v4.1.2 NULL R4: 27th November 2009                             */
/*                                                                              */
/*   TESTING + VERIFICATION::                                                   */
/*     Files Cleaned, Nulled, Checked, Verified By:                             */
/*      -> FLIPMODE!                                                            */
/*     Decoded By:                                                              */
/*      -> FLIPMODE! + Unknown Decoder                                          */
/*     Tested By:                                                               */
/*      -> FLIPMODE!, LeetWolf, and 12 Anonymous Users...                       */
/*     WHMCS 4.1.2 Supplied By:                                                 */
/*      -> WHM CompleteShit Coder @ WHMCS.com                                   */
/*                                                                              */
/*                                                                              */
/*   IMPORTANT NOTE::                                                           */
/*   PLEASE NOTE THIS IS FOR TRIAL PURPOSES ONLY!                               */
/*                          LIKE IT? THEN BUY IT!                               */
/*                                                                              */
/* ========== ########## ========== ########## ========== ########## ========== */


    // header ('Location: index.php');
	// exit ();

require '../dbconnect.php';
require '../includes/functions.php';
require '../includes/adminfunctions.php';
if ($updatekey == 'true')
{
	$result = select_query ('tbladmins', '', array ('username' => $username, 'password' => md5 ($password)));
	$data = mysql_fetch_array ($result);
	$id = $data['id'];
	$roleid = $data['roleid'];
	$result = select_query ('tbladminperms', 'COUNT(*)', array ('roleid' => $roleid, 'permid' => '64'));
	$data = mysql_fetch_array ($result);
	$match = $data[0];
	if (!$newlicensekey)
	{
		echo 'You did not enter a new license key';
		exit ();
	}

	if ((!$id OR !$match))
	{
		echo 'You do not have permission to make this change';
		exit ();
	}

	$attachments_dir = '';
	$downloads_dir = '';
	$customadminpath = '';
	include ROOTDIR . '/configuration.php';
	$output = '<?php
$license="' . $newlicensekey . '";
$db_host = "' . $db_host . '";
$db_username = "' . $db_username . '";
$db_password = "' . $db_password . '";
$db_name = "' . $db_name . '";
$cc_encryption_hash = "' . $cc_encryption_hash . '";
$templates_compiledir = "' . $templates_compiledir . '";
';
	if ($attachments_dir)
	{
		$output .= '$attachments_dir = "' . $attachments_dir . '";
';
	}

	if ($downloads_dir)
	{
		$output .= '$downloads_dir = "' . $downloads_dir . '";
';
	}

	if ($customadminpath)
	{
		$output .= '$customadminpath = "' . $customadminpath . '";
';
	}

	$output .= '?>';
	$fp = fopen ('../configuration.php', 'w');
	fwrite ($fp, $output);
	fclose ($fp);

    /*
    update_query ('tblconfiguration', array ('value' => ''), array ('setting' => 'License'));
    header ('Location: index.php');
	exit ();
    */
}

/* if (!$licenseerror)
{
	$licenseerror = 'invalid';
}

$licenseerror = strtolower ($licenseerror);
$licensing->forceRemoteCheck ();
// Force remote check in LicenseFunctions.php -> Return True
*/

echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Billing &amp; Support System - License: ';
// echo titlecase ($licenseerror);
echo '</title>

<style type="text/css">
<!--
body, td, th {
	font-family: Tahoma, Arial, Helvetica, sans-serif;
	font-size: 11px;
	color: #333;
}
body {
	background-color: #FFF;
	margin: 0;
}
a, a:visited {
	color: #000066;
	text-decoration: underline;
}
a:hover {
	text-decoration: none;
}
form {
	margin: 0;
	padding: 0;
}
input, select, textarea {
	font-family: Tahoma, Arial, Helvetica, sans-serif;
	font-size: 11px;
	padding: 3px;
}
#login_container {
	color: #333;
	background-color: #FFF;
	text-align: left;
	width: 330px;
	padding: 1px;
	margin: 20px auto 10px auto;
	border: 1px solid #CCCCCC;
}
#logo {
	text-align: center;
	margin: 0;
	padding: 50px 0 0 0;
}
#login_container #login {
	background-color: #EFEFEF;
	text-align: left;
	margin: 0;
	padding: 10px;
}
#login_container #login_failed {
    background-color: #FCF9D2;
    text-align: center;
    padding: 10px;
    margin: 0 0 1px 0;
}
#login_container #extra_info {
	background-color: #CCC;
	text-align: left;
	padding: 10px;
	margin: 1px 0 0 0;
}
-->
</style>
</head>
<body>
<div id="logo"><a href="index.php"><img src="images/loginlogo.gif" alt="" width="205" height="62" border="0" /></a></div>
<div id="login_container">
  <div id="login_failed">
';

/*
  <strong>License ';
echo titlecase ($licenseerror);
echo '</strong><br>';
echo $description;
echo '  </div>
  <div id="login">

';
*/


/*
if ($licenseerror == 'suspended')
    {
          echo '<p>Your license key ';
          echo $license;
          echo ' has been suspended.  Possible reasons for this include:</p>

         <p>Got a new license key?  <a href="licenseerror.php?licenseerror=change">Click here to enter it</a></p>
          ';
    }
else
{
	if ($licenseerror == 'pending')
	{
        echo '<p>The License Key ';
		echo $license;
		echo ' you just tried to access is still pending.</p>
<p>Got a new license key?  <a href="licenseerror.php?licenseerror=change">Click here to enter it</a></p>
';
	}
	else
	{
		if ($licenseerror == 'invalid')
		{
			echo '<p>Your license key ';
			echo $license;
			echo ' is invalid. Possible reasons for this include: installation detail mismatch (IP, Domain, Directory, License Key, etc).</p>

<p>Got a new license key?  <a href="licenseerror.php?licenseerror=change">Click here to enter it</a></p>
';
		}
		else
		{
			if ($licenseerror == 'expired')
			{
				echo '<p>Your license key ';
				echo $license;
				echo ' has expired!  To resolve this you can:</p>
<ul>
<li>Order a new license from <a href="http://www.anonym.to/?http://www.whmcs.com/order.php" target="_blank">www.whmcs.com/order.php</a> LOL!</li>
</ul>
<p>Got a new license key?  <a href="licenseerror.php?licenseerror=change">Click here to enter it</a></p>
';
			}
			else
			{
				if ($licenseerror == 'version')
				{
					echo '<p>Your owned license updates period expired before this release! Please renew your support and updates license.</p>
<p>Got a new license key?  <a href="licenseerror.php?licenseerror=change">Click here to enter it</a></p>
';
				}
				else
				{
					if ($licenseerror == 'noconnection')
					{
						echo '<p>No Connection to License Server. We have not been able to verify your license for the past 7-14 days.</p>
<p>Please reactivate your license, OR, confirm no files are contacting remote license servers.</p>
';
					}
					else
					{
						if ($licenseerror == 'change')
						{
							echo '<p>You can change your license key by entering your admin login details and new key below. Must have full admin access.</p>
';
							if (is_writable ('../configuration.php'))
							{
							}
							else
							{
								echo '<p align=center style="color:#cc0000"><b>You must set the permissions for the configuration.php file to 777 so it can be written to before you can change your license key</b></p>';
							}

							if ($loginincorrect)
							{
								echo '<p align=center><b>Login Details Incorrect</b></p>';
							}

							if ($keyblank)
							{
								echo '<p align=center><b>You must enter a new license key to change your key</b></p>';
							}  */

							echo '<form method="post" action="';
							echo $PHP_SELF;
							echo '?licenseerror=change&updatekey=true">
<table align=center>
<tr><td align=right>User Name:</td><td><input type="text" name="username"></td></tr>
<tr><td align=right>Password:</td><td><input type="password" name="password"></td></tr>
<tr><td align=right>New License Key:</td><td><input type="text" name="newlicensekey"></td></tr>
</table>
<p align=center><input type="submit" value="Change License Key"></p>
</form>
';

/*
						}
					}
				}
			}
		}
	}
}
*/


echo '
  </div>
</div>
</body>
</html>';
?>